package router

import (
	"github.com/gin-gonic/gin"
	"yk1-assistant/handler"
)

func Init() *gin.Engine {

	r := gin.Default()
	r.POST("/login", handler.Login)
	r.POST("/adduserrole", handler.AddUserRole)
	r.GET("/listuserrole", handler.ListUserRole)
	r.POST("/addrolenode", handler.AddRoleNode)
	r.GET("/listrolenode", handler.ListRoleNode)
	r.POST("/addcar", handler.AddCar)
	r.POST("/addorder", handler.AddOrder)
	r.GET("/listorder", handler.ListOrder)
	r.GET("/listbigcar", handler.ListBigCar)
	r.GET("/rbac2", handler.UserRoleList2)
	r.GET("/smallcar", handler.ListSmall)
	r.GET("/rbac4", handler.RoleNodeList2)
	return r
}
